package com.geeguo.ebuilder.operation.base.core.dictionary;

import com.geeguo.ebuilder.core.common.dictionary.IDictionary;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;

@Getter
@AllArgsConstructor
public enum ModuleTypeEnum implements IDictionary {

    Catalog(1, "目录"),
    Menu(2, "菜单"),
    Function(3, "功能");

    private final int value;
    private final String label;

    public static List<ModuleTypeEnum> getEnumValues() {
        return Arrays.asList(values());
    }

    public static ModuleTypeEnum parse(int value) {
        for (ModuleTypeEnum item : ModuleTypeEnum.values()) {
            if (value == item.getValue()) {
                return item;
            }
        }
        return null;
    }
}